package dao

import (
	"quipus/internal/profile"
	"sync"
)

// provides global data Store access to all raw objects.
type GdsAccess struct {
	Profile *profile.Profile
	driver  Driver
	Handler DBOperator

	workspaceSettingCache sync.Map // map[string]*storepb.WorkspaceSetting
	userCache             sync.Map // map[int]*User
	userSettingCache      sync.Map // map[string]*storepb.UserSetting
	idpCache              sync.Map // map[int]*storepb.IdentityProvider
}

// New creates a new instance of Store.
func New(driver Driver, profile *profile.Profile, handler DBOperator) *GdsAccess {
	return &GdsAccess{
		driver:  driver,
		Profile: profile,
		Handler: handler,
	}
}

func (s *GdsAccess) Close() error {
	return s.driver.Close()
}
